/**
 Copyright (C) 2013 Yuyao Liang

 This source code is release under the BSD License.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.

 Created on Mar 6, 2014 2:55:23 PM
 */
package com.googlecode.exitrule.ui.event;

import java.util.ArrayList;
import java.util.EventObject;
import java.util.List;

/**
 * @author lianyuy
 * 
 */
public class RecordEventsManager {
	private List<RecordCreateEvent> createEventList = new ArrayList<RecordCreateEvent>();
	private List<RecordShowUpEvent> showUpEventList = new ArrayList<RecordShowUpEvent>();
	private List<RecordUpdateEvent> updateEventList = new ArrayList<RecordUpdateEvent>();

	public RecordEventsManager() {
		super();
	}

	public void addListener(EventObject listener) {
		if (listener instanceof RecordCreateEvent) {
			createEventList.add((RecordCreateEvent) listener);
		}
		if (listener instanceof RecordShowUpEvent) {
			showUpEventList.add((RecordShowUpEvent) listener);
		}
		if (listener instanceof RecordUpdateEvent) {
			updateEventList.add((RecordUpdateEvent) listener);
		}
	}
}
